<?php
declare(strict_types=1);

namespace App\Http\Controllers;

use App\Http\Requests\ImageValidate;
use App\Library\Response;
use App\Logic\User\Service\ImageShareService;
use Illuminate\Http\JsonResponse;

class ImageShareController extends Controller
{
    public function share(ImageValidate $validate): JsonResponse
    {
        $shareResult = (new ImageShareService())->serviceCreate(request()->all());
        if ($shareResult["code"] == 0) {
            return Response::success($shareResult);
        }
        return Response::success($shareResult);
    }
}
